Proyectos de Subversion LeadersLinked - Backend

Rev

Autoría | Ultima modificación | Ver Log |

<?php
declare(strict_types=1);

namespace LeadersLinked\Form\Planning;

use Laminas\Form\Form;

class PlanningGoalForm extends Form
{

    public function __construct()
    {
        parent::__construct();
        
        $this->setInputFilter(new PlanningGoalFilter());

        $this->add([
            'name' => 'title',
            'type' => \Laminas\Form\Element\Text::class,
            'attributes' => [
                'maxlength'     => 128,
                'id'                    => 'title',
            ]
        ]);
        
        $this->add([
            'name' => 'description',
            'type' => \Laminas\Form\Element\Textarea::class,
            'attributes' => [
                'id'    => 'description',
                'maxlength'     => 1024,
                'rows' => 5,    
            ]
        ]);
        
        
        $this->add([
            'name' => 'progress',
            'type' => \Laminas\Form\Element\Number::class,
            'attributes' => [
                'min' => 0,
                'max' => 100,
                'step' => 1,
                'id' => 'progress',
            ]
        ]);


        $this->add([
            'name' => 'status',
            'type' => \Laminas\Form\Element\Checkbox::class,
            'attributes' => [
                'id'                    => 'status',
            ],
            'options' => [
                'use_hidden_element' => false,
                'unchecked_value' => \LeadersLinked\Model\PlanningGoal::STATUS_INACTIVE,
                'checked_value'=> \LeadersLinked\Model\PlanningGoal::STATUS_ACTIVE,
            ]
        ]);
        
        $this->add([
            'name' => 'date_range',
            'type' => \Laminas\Form\Element\Text::class,
            'attributes' => [
                'id'    => 'date_range',
            ]
        ]);
        
        $this->add([
            'name' => 'start',
            'type' => \Laminas\Form\Element\Hidden::class,
            'attributes' => [
                'id'    => 'start',
            ],
        ]);
        
        $this->add([
            'name' => 'end',
            'type' => \Laminas\Form\Element\Hidden::class,
            'attributes' => [
                'id'    => 'end',
            ],
        ]);
        
        $this->add([
            'name' => 'budget',
            'type' => \Laminas\Form\Element\Number::class,
            'attributes' => [
                'id'    => 'budget',
                'step' => 0.01,
                'min' => 0,
                'max' => 999999999999.99
            ],
        ]);
        
        
        
        $this->add([
            'name' => 'cost',
            'type' => \Laminas\Form\Element\Number::class,
            'attributes' => [
                'id'    => 'cost',
                'readonly' => 'readonly'
            ],
        ]);
        

    }

}