<?php
$GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"] ?: array()) + array();
class WFHistoryProvider
{
    
    
    
    
    
    
    protected $wf;
    
    
    
    
    
    
    protected $wf_id;
    
    
    
    
    
    
    protected $cur_state_record;
    
    
    
    
    
    
    protected $cur_state;
    
    
    
    
    
    
    public $document;
    public function Init(ERMSDataObj $_fc4ffcaec4dff19ed04cc1c9229222d1)
    {
        $this->document = $_fc4ffcaec4dff19ed04cc1c9229222d1;
        $this->wf_id = $_fc4ffcaec4dff19ed04cc1c9229222d1->GetWorkflowId();
        $this->wf = new WFWorkflow();
        $this->wf->Load($this->wf_id);
        $this->cur_state = $this->wf->GetCurrentState($_fc4ffcaec4dff19ed04cc1c9229222d1);
        $this->cur_state_record = $this->cur_state->GetCurrentStateRecord($_fc4ffcaec4dff19ed04cc1c9229222d1);
    }
    public function GetManualTransitions()
    {
        $_f274035cf280fb57c0c9ef54d849a83d = array();
        foreach ($this->cur_state->GetAllTransitions() as $_25b9db1c0742750fdff46948cbf57c67) {
            
            
            if ($_25b9db1c0742750fdff46948cbf57c67->GetType() == WF_TRANSITION_NONE && $_25b9db1c0742750fdff46948cbf57c67->UserHasPermission(PERM_VIEW)) {
                $_f274035cf280fb57c0c9ef54d849a83d[] = $_25b9db1c0742750fdff46948cbf57c67;
            }
        }
        return $_f274035cf280fb57c0c9ef54d849a83d;
    }
    
    
    
    
    
    
    public function GetApprovalTransitions()
    {
        $_f274035cf280fb57c0c9ef54d849a83d = array();
        foreach ($this->cur_state->GetAllTransitions() as $_25b9db1c0742750fdff46948cbf57c67) {
            
            
            if ($_25b9db1c0742750fdff46948cbf57c67->GetType() !== WF_TRANSITION_NONE && !$_25b9db1c0742750fdff46948cbf57c67->IsAuto() && $_25b9db1c0742750fdff46948cbf57c67->UserHasPermission(PERM_VIEW)) {
                $_f274035cf280fb57c0c9ef54d849a83d[] = $_25b9db1c0742750fdff46948cbf57c67;
            }
        }
        return $_f274035cf280fb57c0c9ef54d849a83d;
    }
}