public function getCMSFields()
    {
        $fields = new FieldList();
        $fields->push(new TabSet('Root', new Tab('Main')));

        if (Permission::check('REASSIGN_ACTIVE_WORKFLOWS')) {
            if ($this->WorkflowStatus == 'Paused' || $this->WorkflowStatus == 'Active') {
                $cmsUsers = Member::mapInCMSGroups();

                $fields->addFieldsToTab('Root.Main', array(
                    new HiddenField('DirectUpdate', '', 1),
                    new HeaderField(
                        'InstanceReassignHeader',
                        _t('WorkflowInstance.REASSIGN_HEADER', 'Reassign workflow')
                    ),
                    new CheckboxSetField('Users', _t('WorkflowDefinition.USERS', 'Users'), $cmsUsers),
                    new TreeMultiselectField('Groups', _t('WorkflowDefinition.GROUPS', 'Groups'), Group::class)
                ));
            }
        }

        if ($this->canEdit()) {
            $action = $this->CurrentAction();
            if ($action->exists()) {
                $actionFields = $this->getWorkflowFields();
                $fields->addFieldsToTab('Root.Main', $actionFields);

                $transitions = $action->getValidTransitions();
                if ($transitions) {
                    $fields->replaceField(
                        'TransitionID',
                        DropdownField::create("TransitionID", "Next action", $transitions->map())
                    );
                }
            }
        }

        $items = WorkflowActionInstance::get()->filter(array(
            'Finished'   => 1,
            'WorkflowID' => $this->ID
        ));

        $grid = new GridField(
            'Actions',
            _t('WorkflowInstance.ActionLogTitle', 'Log'),
            $items
        );

        $fields->addFieldsToTab('Root.Main', $grid);

        return $fields;
    }
public function getCMSFields()
    {
        $fields = new FieldList();
        $fields->push(new TabSet('Root', new Tab('Main')));

        if (Permission::check('REASSIGN_ACTIVE_WORKFLOWS')) {
            if ($this->WorkflowStatus == 'Paused' || $this->WorkflowStatus == 'Active') {
                $cmsUsers = Member::mapInCMSGroups();

                $fields->addFieldsToTab('Root.Main', array(
                    new HiddenField('DirectUpdate', '', 1),
                    new HeaderField(
                        'InstanceReassignHeader',
                        _t('WorkflowInstance.REASSIGN_HEADER', 'Reassign workflow')
                    ),
                    new CheckboxSetField('Users', _t('WorkflowDefinition.USERS', 'Users'), $cmsUsers),
                    new TreeMultiselectField('Groups', _t('WorkflowDefinition.GROUPS', 'Groups'), Group::class)
                ));
            }
        }

        if ($this->canEdit()) {
            $action = $this->CurrentAction();
            if ($action->exists()) {
                $actionFields = $this->getWorkflowFields();
                $fields->addFieldsToTab('Root.Main', $actionFields);

                $transitions = $action->getValidTransitions();
                if ($transitions) {
                    $fields->replaceField(
                        'TransitionID',
                        DropdownField::create("TransitionID", "Next action", $transitions->map())
                    );
                }
            }
        }

        $items = WorkflowActionInstance::get()->filter(array(
            'Finished'   => 1,
            'WorkflowID' => $this->ID
        ));

        $grid = new GridField(
            'Actions',
            _t('WorkflowInstance.ActionLogTitle', 'Log'),
            $items
        );

        $fields->addFieldsToTab('Root.Main', $grid);

        return $fields;
    }
public function getCMSFields ( ) { $ fields = new FieldList ( ) ; $ fields -> push ( new TabSet ( 'Root' , new Tab ( 'Main' ) ) ) ; if ( Permission :: check ( 'REASSIGN_ACTIVE_WORKFLOWS' ) ) { if ( $ this -> WorkflowStatus == 'Paused' || $ this -> WorkflowStatus == 'Active' ) { $ cmsUsers = Member :: mapInCMSGroups ( ) ; $ fields -> addFieldsToTab ( 'Root.Main' , array ( new HiddenField ( 'DirectUpdate' , '' , 1 ) , new HeaderField ( 'InstanceReassignHeader' , _t ( 'WorkflowInstance.REASSIGN_HEADER' , 'Reassign workflow' ) ) , new CheckboxSetField ( 'Users' , _t ( 'WorkflowDefinition.USERS' , 'Users' ) , $ cmsUsers ) , new TreeMultiselectField ( 'Groups' , _t ( 'WorkflowDefinition.GROUPS' , 'Groups' ) , Group :: class ) ) ) ; } } if ( $ this -> canEdit ( ) ) { $ action = $ this -> CurrentAction ( ) ; if ( $ action -> exists ( ) ) { $ actionFields = $ this -> getWorkflowFields ( ) ; $ fields -> addFieldsToTab ( 'Root.Main' , $ actionFields ) ; $ transitions = $ action -> getValidTransitions ( ) ; if ( $ transitions ) { $ fields -> replaceField ( 'TransitionID' , DropdownField :: create ( "TransitionID" , "Next action" , $ transitions -> map ( ) ) ) ; } } } $ items = WorkflowActionInstance :: get ( ) -> filter ( array ( 'Finished' => 1 , 'WorkflowID' => $ this -> ID ) ) ; $ grid = new GridField ( 'Actions' , _t ( 'WorkflowInstance.ActionLogTitle' , 'Log' ) , $ items ) ; $ fields -> addFieldsToTab ( 'Root.Main' , $ grid ) ; return $ fields ; }
Get the CMS view of the instance. This is used to display the log of
this workflow, and options to reassign if the workflow hasn't been
finished yet

@return FieldList
Get the CMS view of the instance . This is used to display the log of this workflow and options to reassign if the workflow hasn t been finished yet